package cn.signalpha.modules.shop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 运费模版实体类
 *
 * @author suguangjun
 */
@Data
@TableName("shop_transport")
@ApiModel(value = "Transport对象", description = "运费模版")
public class Transport implements Serializable {

    private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
    private Long id;

	@NotBlank
    @ApiModelProperty(value = "运费模板名称")
    private String name;

    @ApiModelProperty(value = "商户id")
    private Long sellerId;

    @NotNull
    @ApiModelProperty(value = "收费方式（0 按件数,1 按重量 2 按体积）")
    private Integer chargeType;

	@NotNull
    @ApiModelProperty(value = "是否包邮")
    private Integer isFree;

	@NotNull
    @ApiModelProperty(value = "是否含有包邮条件")
    private Integer isFreeCondition;

	@ApiModelProperty(value = "创建时间")
	private Date createTime;

	@TableField(exist=false)
	@ApiModelProperty(value = "运费项",required=true)
	private List<TransportFee> transportFeeList;

    @TableField(exist=false)
    @ApiModelProperty(value = "指定条件包邮项",required=true)
    private List<TransportFeeFree> transportFeeFreeList;

}
